package com.design.patterns.structuralModel.chainofresponsibility.service.impl;

import com.design.patterns.structuralModel.chainofresponsibility.bean.Request;

public class AuthMiddleware extends MiddlewareAbstract {
    @Override
    public boolean check(Request request) {
        String auth = (String) request.getQuery().get("Auth");
        if ("admin".equals(auth)){
            System.out.println("欢迎，管理员");
        }else {
            System.out.println("欢迎，游客");
        }
        return checkNext(request);
    }
}
